﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HotelManager.BusinessLogic.Abstract;
using HotelManager.DataAccess;
using HotelManager.DataAccess.Abstract;
using HotelManager.DataAccess.Model;

namespace HotelManager.BusinessLogic.Concrete
{
    public class HotelService : IHotelService
    {
        private IHotelRepository hotelRepository;

        public HotelService(IHotelRepository hotelRepository)
        {
            this.hotelRepository = hotelRepository;
        }

        public IQueryable<Hotel> GetAllHotels()
        {
            return hotelRepository.Hotels;
        }

        public List<Hotel> SearchHotel(SearchModel model)
        {
            // Validate model here
            return hotelRepository.SearchHotel(model);
        }

        public HotelInfosModel GetHotelDescription(int hotelId)
        {
            return hotelRepository.GetHotelDescription(hotelId);
        }

        public List<HotelOption> GetAllHotelOptions()
        {
            return hotelRepository.GetAllHotelOptions();
        }


        public List<Option> GetAllOptions()
        {
            return hotelRepository.GetAllOptions();
        }


        public bool BookingHotel(Booking book)
        {
            return hotelRepository.BookingHotelRoom(book);
        }


        public BookingRoomInfo GetRoomInfo(int id, DateTime checkIn)
        {
            return hotelRepository.GetRoomInfo(id, checkIn);
        }

        
    }
}
